package com.sa.module.uif.pojo;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

/**
 * 活动列表：集合了用户的所有活动，包括组织、参与、受邀、收集
 * @author huangxin
 *
 */
@MappedSuperclass
public class AbstractAList {

	private int id;
	private Users users;	//用户
	private Activity activity;
	private int kind;		//活动类型：1：组织；2：参与；3：受邀；4：收集
	
	public AbstractAList(int id, Users users, Activity activity, int kind) {
		super();
		this.id = id;
		this.users = users;
		this.activity = activity;
		this.kind = kind;
	}
	
	public AbstractAList() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	@Id 
	@GeneratedValue(strategy=IDENTITY)	    
	@Column(name="ID", unique=true, nullable=false)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UID", nullable = true)
	public Users getUsers() {
		return users;
	}
	public void setUsers(Users users) {
		this.users = users;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AID", nullable = true)
	public Activity getActivity() {
		return activity;
	}
	public void setActivity(Activity activity) {
		this.activity = activity;
	}
	
	@Column(name="KIND", nullable=true)
	public int getKind() {
		return kind;
	}
	public void setKind(int kind) {
		this.kind = kind;
	}
	@Override
	public String toString() {
		return "AbstractAList [id=" + id + ", users=" + users + ", activity="
				+ activity + ", kind=" + kind + "]";
	}
	
	
}
